package entity;
import control.*;
import java.awt.event.KeyEvent;

import java.util.*;

public abstract class GameMovableObj extends GameObj implements Moveable {
	
	private static ArrayList<GameMovableObj> gameMovableObj = new ArrayList<GameMovableObj>();
	private int moveDirection = 0; 
    public GameMovableObj(String imgs) {
		super(imgs);
		gameMovableObj.add(this);
    }
	public GameMovableObj(String img, int cropwidth, int cropheight) {
		super(img,cropwidth,cropheight);
		gameMovableObj.add(this);
    }
	public void move(int moveX, int moveY) {
        setX(getX()+ moveX);
        setY(getY()+ moveY);
    }
	
	public void setMoveDirection(int d) {
		moveDirection = d;
	}
	public int getMoveDirection() {
		return moveDirection;
	}
	public static ArrayList<GameMovableObj> getGameMovableObj() {
		return gameMovableObj;
	}
	public static void setGameMovableObj(GameMovableObj go) {
		gameMovableObj.add(go);
	}
	public static GameMovableObj getSpecificObj(int index){
		return gameMovableObj.get(index);
	}
    public abstract void keyPressed(KeyEvent e);
    public abstract void keyReleased(KeyEvent e);
}
